package cn.edu.hizee.gps.model;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "t_unusual", schema = "EHelp", catalog = "")
public class Unusual {
    private int id;
    private Integer userId;
    private String unusualTime;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id")
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "unusual_time")
    public String getUnusualTime() {
        return unusualTime;
    }

    public void setUnusualTime(String unusualTime) {
        this.unusualTime = unusualTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Unusual unusual = (Unusual) o;
        return id == unusual.id &&
                Objects.equals(userId, unusual.userId) &&
                Objects.equals(unusualTime, unusual.unusualTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, unusualTime);
    }
}
